1. Technical Field
This invention relates to managing metadata in response to read and write operations. More specifically, a technique is provided to maintain a window of address translations for use in both read and write operations in a shared file system.
2. Description of the Prior Art
FIG. 1 is a prior art block diagram (10) of a distributed file system including a server cluster (20), a plurality of client machines (12), (14), and (16), and a storage area network (SAN) (30). Each of the client machines communicate with one or more server machines (22), (24), and (26) in server cluster (20) over a data network (40). Similarly, each of the client machines (12), (14), and (16) and each of the server machines in the server cluster (20) are in communication with the storage area network (30). The storage area network (30) includes a plurality of shared disks (32) and (34) that contain only blocks of data for associated files. Similarly, the server machines (22), (24), and (26) manage metadata located in the meta data storage space (36) of the storage area network (30) pertaining to location and attributes of the associated files. Each of the client machines may access an object or multiple objects stored on the file data space (38) of the SAN (30), but may not access the metadata space (36). In opening the contents of an existing file object on the storage media in the SAN (30), a client machine contacts one of the server machines to obtain object metadata and locks. Typically, the metadata supplies the client with information about a file, such as its attributes and location on storage devices. Locks supply the client with privileges it needs to open a file and read or write data. The server machine performs a look-up of metadata information for the requested file within metadata space of the SAN (30). The server machine communicates granted lock information and file metadata to the requesting client machine, including the addresses of all data blocks making up the file. Once the client machine holds a lock and knows the data block address or addresses, the client machine can access the data for the file directly from a shared storage device (32) or (34) attached to the SAN (30). The quantity of elements in the system (10), including server nodes in the cluster, client machines, and storage media are merely an illustrative quantity. The system may be enlarged to include additional elements, and similarly, the system may be reduced to include fewer elements. As such, the elements shown in FIG. 1 are not to be construed as a limiting factor.
As shown in FIG. 1, the illustrated distributed file system separately stores metadata and data. In one example, one of the servers in the server cluster (20) holds information about shared objects, including the addresses of data blocks in storage that a client may access. To read a shared object, the client obtains the file's data block address or addresses from the server and then reads the data from the storage at the given block address or addresses. Similarly, when writing to a shared object, the client requests the server to create storage block addresses for data and then requests the allocated block addresses to which the data will then be written. One known method for reading a shared object uses a sequential block allocation method. For a shared object that is read sequentially, the client asks the server for the data block addresses corresponding to a first segment. Upon receiving the block addresses, the client reads the data in the first segment. If the application requires the client to read beyond the first segment, the client asks the server for the data block addresses corresponding to the next segment, and upon receipt of the block addresses, the client reads the data in the next segment. Similarly, for a sequential write operation, the client asks the server to allocate space for a first segment. Upon receiving the data block addresses for the first segment, the client writes data into the data blocks in the first segment. If the application requires additional segments, the client sends a communication to the server to allocate space for a second segment, and the client writes data into the blocks of the next segment upon receiving the data block addresses. Both the read and write operations of the sequential block allocation method require the client to request from the server data block addresses for successive addresses within the shared object during a read or write procedure. The client uses these data block addresses to translate read or write operations on the object to read or write operations on the storage device. Because the client remembers the correspondence between data addresses within the object and data addresses within the storage device, the remembered data block addresses that were fetched from the server are called address translations, as they let the client translate an object-relative address into an address within the storage device. Similarly, the request from the client to the server for data block addresses is sometimes called an address translation request. Accordingly, the sequential block allocation technique requires additional client-server communications if an initial allocation request does not provide a sufficient quantity of data block addresses.
As explained above, the sequential block allocation technique supports a plurality of client-server communications, in response to insufficiency of data block addresses in an initially returned segment. This results in an increased bandwidth consumption, also known as increased network traffic. Therefore, there is a need for a technique that mitigates client-server communications for block address translations for each read and each write operation. Such a technique should ensure mitigation of network traffic by decreasing the quantity of client-server transactions, as well as mitigation of wastage of disk space.